package entity.other;

public class Example {
    private int value;

    public Example(int value) {
        this.value = value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public void printValue() {
        System.out.println("Value: " + value);
    }

    public static void main(String[] args) {
        Example obj1 = new Example(10);
        Example obj2 = new Example(20);

        System.out.println("Before swap:");
        obj1.printValue();
        obj2.printValue();

        swap(obj1, obj2);

        System.out.println("\nAfter swap:");
        obj1.printValue();
        obj2.printValue();
    }

    public static void swap(Example a, Example b) {
        Example temp = a;
        a = b;
        b = temp;

        temp.printValue();
    }
}
